IF(MITK_USE_BLUEBERRY)
  SET(MITK_USE_BLUEBERRY 1)  
  FIND_PACKAGE(MITK REQUIRED)
  
  IF(NOT BLUEBERRY_MFPARSER)
    INCLUDE(${MITK_BINARY_DIR}/Bundles/MITKCoreBundleList.cmake)
  ENDIF()
  
  INCLUDE(berryTestingHelpers)

  SET(BLUEBERRY_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp")
  GET_TARGET_PROPERTY(_is_macosx_bundle CoreApp MACOSX_BUNDLE)
  IF(APPLE AND _is_macosx_bundle) 
    SET(BLUEBERRY_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp.app/Contents/MacOS/CoreApp")
  ENDIF()
  
  SET(BLUEBERRY_TEST_APP_ID "org.mitk.qt.application")
  
  MACRO_COLLECT_PLUGINS(OUTPUT_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/CoreBundles
                        CACHE_PLUGIN_SOURCE_DIRS MITK_CORE_PLUGIN_SOURCE_DIRS
                        CACHE_PLUGIN_OUTPUT_DIRS MITK_CORE_PLUGIN_OUTPUT_DIRS
                        CACHE_PLUGIN_TARGETS MITK_CORE_ENABLED_TEST_PLUGINS
                        CMAKE_CACHE_PREFIX "MITK"
#                        DEPENDS "${BLUEBERRY_PLUGINS_OUTPUT_DIR}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreBundles"
                        ${MITK_BUILD_ALL_PLUGINS_OPTION})

MESSAGE("SUFFIX: ${CMAKE_EXECUTABLE_SUFFIX}")   
ENDIF(MITK_USE_BLUEBERRY)
